<template>
  <!-- 顶部navbar栏 -->
  <div class="ttnavbar" ref="navbar">
    <van-nav-bar :title="title">
      <template #left>
        <slot name="zuoshang"
          ><van-icon @click="$router.back()" name="arrow-left" class="myicon"
        /></slot>
      </template>
      <template #right>
        <span class="rtop"><slot name="youshangjiao"></slot></span>
      </template>
    </van-nav-bar>
  </div>
</template>
<script>
export default {
  props: ['title'],
  name: 'ttnavbar',
  data () {
    return {
      height: 0
    }
  },
  methods: {
    save () {
      this.$emit('save')
    },
    created () {
      this.height = this.$refs.navbar.offsetHeight
      console.log(this.height)
    }
  },
  components: {}
}
</script>
<style lang="less" scoped>
.ttnavbar {
  .myicon {
    font-size: 20px;
  }
  /deep/ .van-nav-bar__left {
    padding-left: 10px;
  }
  /deep/.van-nav-bar__content {
    background-color: #3296fa;
  }
  /deep/.van-nav-bar__title {
    color: whitesmoke;
  }

  /deep/.van-nav-bar .van-icon {
    color: whitesmoke;
  }
  .rtop {
    color: whitesmoke;
  }
}
</style>
